﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace com.ReinforceLab.AudioModem.LinkLayer
{/*
    class LowPassFilter
    { 
        #region Variables      
        int _average;        
        #endregion

        #region Constructor
        public LowPassFilter()
        {
            _average = 0;
        }
        #endregion

        #region Public methods
        public int[] Filter(short[] waveform)
        {
            var demod_sig = new List<int>();
            foreach (var sig in waveform)
            {
                demod_sig.Add(sig - (_average >> 5));

                int diff = (sig << 5) - _average;
                _average += (diff >> 5); // time constant 32 sampling time
            }
            return demod_sig.ToArray();
        }
        #endregion
    }*/
}
